package cn.nucpyh.soft;
//内部类
public class Test_April7 {
    //outer
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public void test1(){
        System.out.println("这是外部类!");
    }

    //inner
    class Inner{
        private int age;
        private String name;
        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }
//        展示外部类的信息
        void show1(){
            System.out.println("outer:" + this.name);
        }
        public void test2(){
            System.out.println("这是内部类!");
            test1();
        }
    }

    void show2(){
        Inner inner = new Inner();
        System.out.println("inner.age:" + inner.age + "\ninner.name:" + name);
        inner.test2();
    }

    static class Innerstatic{
        private int age;

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }
        public void test3(){
            System.out.println("static内部类");

        }
    }
}
